#ifndef VECTOR_H
#define VECTOR_H
#include "misc.h"
class Vector
{
private:
    double *d;
    int dim;
public:
    Vector();
    Vector(double x,double y,double z,int dim=3);
    ~Vector();
    double getX(){return d[0];}
    double getY(){return d[0];}
    double getZ(){return d[0];}
    void setCoords(double x,double y, double z){d[0]=x; d[1]=y;d[2]=z;}
    void setCoords(double *d){delete this->d;this->d = d;}//delete old coords -> add new coords
    double *getCoords(){return d;};
    double calculateMagnitude(){
        double mag = 0;
        for(int i = 0; i<dim; ++i)
        {
            mag = d[i]*d[i];
        }
        return sqrt(mag);
    }

    Vector* operator+(Vector*);
    Vector* operator+(double*);
    Vector* operator*(Vector*);
    Vector* operator*(double*);
    Vector* operator*(double);
};

#endif // VECTOR_H
